﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.XtraEditors;
using System.Windows.Forms;

namespace FisApp.utility
{
    public class DevExpressHelper
    {
        public static void MakeAutoComplete(TextEdit textEdit, AutoCompleteMode autoCompleteMode, AutoCompleteSource autoCompleteSource)
        {
            // http://community.devexpress.com/forums/p/81601/280039.aspx
            var tx = textEdit.MaskBox; 
            tx.AutoCompleteSource = autoCompleteSource;
            tx.AutoCompleteMode = autoCompleteMode;
        }

        public static void MakeAutoComplete(ComboBoxEdit comboBoxEdit, AutoCompleteMode autoCompleteMode, AutoCompleteSource autoCompleteSource)
        {
            // http://community.devexpress.com/forums/p/81601/280039.aspx
            var tx = comboBoxEdit.MaskBox;
            tx.AutoCompleteSource = autoCompleteSource;
            tx.AutoCompleteMode = autoCompleteMode;
        }
    }
}
